<template>
  <div class="form">
    <input type="text" v-model="inputRef" />
    <button @click="addTodo">ADD</button>
  </div>
</template>

<script setup>
import { ref } from 'vue';
import { useStore } from 'vuex';

const inputRef = ref('');

const store = useStore();
const addTodo = () => {
  store.dispatch('addTodo', inputRef.value);
  inputRef.value = '';
};
</script>

<style scoped></style>
